The purpose of this Document is to demonstrate gene-snp pairs that have high loadings. First we need to load the posterior wieghts and pis.

First, we recall the covariance matrices:

for(i in 1:19){
weightplot(genename = which(cols==3&rows>10)[i],max.weight = 3,covmat = covmat)
}

for(i in 1:20){
print(c(i,rownames(z.stat)[which(cols==9&rows>10)[i]]))
}

First, we show examples with high loadings on \(U_K2\) and \(U_K3\) which are the rank 44 and rank 3 Output of ED, initialized with the Empirical Covariance Matrix and the Rank 3 dimensional reduction of it.

Next, we show examples from some of the single rank matrices. Some things to remember:

in 4, we observe tissue specific behavior in whole blood and we note that the brains and whole blood are correlated while everything else is anticorrelated

in 5, brain was anticorrelated with most other tissues

Note how in 8, testes is anticorrelated with everything and also tissue specific

library(gplots)
library(ggplot2)

k=8
x=covmat[[k]]/max(diag(covmat[[k]]))
  colnames(x)=colnames(z.stat)
  rownames(x)=colnames(z.stat)
heatmap.2(x,Rowv=FALSE,Colv=FALSE,symm=TRUE,dendrogram="none",density="none",trace="none",col=redblue(256),main=paste0("HeatMapofCov2CorU_k",k),cexRow=0.5,cexCol=0.5,symkey=T,symbreaks=T,names=colnames(z.stat))
## Warning in plot.window(...): "names" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "names" is not a graphical parameter
## Warning in title(...): "names" is not a graphical parameter

eight.ex.2=which(rownames(z.stat)=="ENSG00000169962.4_1_909238_G_C_b37")
eight.ex.3=which(rownames(z.stat)=="ENSG00000126070.14_1_36363172_C_T_b37")
eight.ex.4=which(rownames(z.stat)=="ENSG00000121073.9_17_48685792_G_A_b37")

weightplot(genename = eight.ex.2,max.weight = 8,covmat = covmat)

weightplot(genename = eight.ex.3,max.weight = 8,covmat = covmat)

weightplot(genename = eight.ex.4,max.weight = 8,covmat = covmat)

And in 9, we see small effects in brain and large tissue specific effects in testis and whole blood

k=9
x=covmat[[k]]/max(diag(covmat[[k]]))
  colnames(x)=colnames(z.stat)
  rownames(x)=colnames(z.stat)                  
heatmap.2(x,Rowv=FALSE,Colv=FALSE,symm=TRUE,dendrogram="none",density="none",trace="none",col=redblue(256),main=paste0("HeatMapofNormalizedUk",k),cexRow=0.5,cexCol=0.5,symkey=T,symbreaks=T)

nine.ex.2=which(rownames(z.stat)=="ENSG00000059588.5_1_234612995_T_C_b37")
nine.ex.3=which(rownames(z.stat)=="ENSG00000009830.7_14_77776501_T_A_b37")
nine.ex.4=which(rownames(z.stat)=="ENSG00000011021.17_1_11869101_T_C_b37")

weightplot(genename = nine.ex.2,max.weight = 9,covmat = covmat)

weightplot(genename = nine.ex.3,max.weight = 9,covmat = covmat)

#weightplot(genename = nine.ex.4,max.weight = 9,covmat = covmat)

newfunc(t=nine.ex.2)

newfunc(t=nine.ex.3)